package com.tk.service;

import com.tk.dao.BookMapper;
import com.tk.pojo.Books;

import java.util.List;


public class BookServiceImpl implements BookService {


    private BookMapper bookMapper;

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    public int addBook(Books books) {
        return bookMapper.addBook(books);
    }

    public int deteleBookById(int id) {
        return bookMapper.deteleBookById(id);
    }

    public int updateBook(Books books) {
        System.out.println("BookServiceImpl: updateBook=>" + books);
        return bookMapper.updateBook(books);
    }

    public Books queryBookById(int id) {
        return bookMapper.queryBookById(id);
    }

    public List<Books> queryAllBook() {
        return bookMapper.queryAllBook();
    }

    public Books queryBookByName(String bookName) {
        return bookMapper.queryBookByName(bookName);
    }


}
